import 'package:flutter/material.dart';
import 'package:ost_flutter_module/common/adapt.dart';
import 'package:ost_flutter_module/common/color.dart';
import 'package:ost_flutter_module/common/defines_macro.dart';
import 'package:ost_flutter_module/common/styles.dart';
import 'package:ost_flutter_module/widget/custom_widget/text_button.dart';

class StoreVedioWidget extends StatelessWidget {
  const StoreVedioWidget({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.black,
      height: Adapt.px(280),
      padding: EdgeInsets.symmetric(vertical: Adapt.px(35)),
      child: Container(
        decoration: BoxDecoration(
            image: DecorationImage(image: NetworkImage(default_image))),
        child: VedioMask(
          onPressed: () {},
        ),
      ),
    );
  }
}

class VedioMask extends StatelessWidget {
  final VoidCallback onPressed;
  const VedioMask({Key key, this.onPressed}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Opacity(
          opacity: 0.5,
          child: Container(
            color: Colors.black,
          ),
        ),
        Center(
          child: GTextButton(
            fontSize: 16,
            child: Row(
              mainAxisSize: MainAxisSize.min,
              children: [
                Icon(
                  Icons.play_circle_fill_rounded,
                  color: colorFACD33,
                  size: Adapt.px(22),
                ),
                SizedBox(width: Adapt.px(4)),
                Text('试听', style: TextStyles.titleStyle),
              ],
            ),
            radius: 5,
            normalForgroundColor: color303030,
            normalBackgroundColor: Colors.white,
            onPressed: onPressed,
          ),
        ),
      ],
    );
  }
}
